
<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/favicon.ico">
    <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/signin/">

    <title>编辑学生信息</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/examples/signin/signin.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">
        <form action="/students/edit" method="post">
            <input type="hidden" name = "id" value="{{thestudent.id}}">
            <div class="form-group">
              <label for="exampleInputEmail1">学生姓名</label>
              <input type="text" class="form-control" id="" name='name' value="{{ thestudent.name }}" placeholder="姓名">
            </div>
            <label for="exampleInputEmail1">性别</label><br>
            <label class="radio-inline">
                <input class="sex" type="radio"  id="" name='sex' value="{{ thestudent.sex }}" > 男
              </label>
              <label class="radio-inline">
                <input class="sex" type="radio"  id="" name='sex' value="{{ thestudent.sex }}"> 女
              </label>
            <div class="form-group">
              <label for="exampleInputPassword1">年龄</label>
              <input type="text" class="form-control" id="" name= 'age' value="{{thestudent.age}}" placeholder="请根据身份证日期填写">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">爱好</label>
                <input type="text" class="form-control" id="" name='hobby' value="{{thestudent.hobby}}" placeholder="不得少于一个">
              </div>
            <button type="submit" class="btn btn-default">提交</button>
          </form>

    </div> <!-- /container -->
    <script>
      var sex= document.querySelectorAll('.sex');
      if(sex[0].value === "男"){
        console.log(sex[0].value)
        sex[0].checked = "checked";
      }else{
        sex[1].checked = "checked";
      }
    </script>

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.17/assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>
